Skip to content

Conversation

@gadenbuie
Copy link
Contributor

Prior to this PR, if you pass in a database connection to querychat_app() it will close your connection for you. You only would want that if querychat created the table connection internally, i.e. if you passed in a data.frame.

Before

pkgload::load_all()

con <- DBI::dbConnect(duckdb::duckdb())
duckdb::dbWriteTable(con, "mtcars", mtcars)

querychat_app(con, "mtcars")
#> Closing data source...

DBI::dbGetQuery(con, "SELECT * FROM mtcars LIMIT 5;")
#> Error in `dbSendQuery()`:
#> ! Invalid connection
#> ℹ Context: rapi_prepare

After

The database connection remains intact and the dbGetQuery() call completes as expected.

@gadenbuie gadenbuie requested a review from cpsievert December 10, 2025 21:44
@gadenbuie gadenbuie force-pushed the r/fix/querychat-app-cleanup branch from dbc5de0 to f100e79 Compare December 16, 2025 15:49
@gadenbuie gadenbuie requested a review from cpsievert December 16, 2025 15:49
@gadenbuie gadenbuie requested a review from cpsievert December 16, 2025 16:36
Copy link
Contributor

@cpsievert cpsievert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@gadenbuie gadenbuie merged commit 93dcaf8 into main Dec 16, 2025
10 of 12 checks passed
@gadenbuie gadenbuie deleted the r/fix/querychat-app-cleanup branch December 16, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants